package cn.edu.xjtu.data_structure.experiment.ex_1;

import java.math.BigInteger;
import java.util.Scanner;

/**
 * @author yjq
 * @version 1.0
 * @date 2021/10/23 15:15
 */
public class BigNumberTest {

    public static void main(String[] args) {

        Scanner in = new Scanner(System.in);
        BigInteger bigInteger = new BigInteger("1234556");

        String num1="12345678901234";
        String num2="23456789124355";
        String num3="-234565";
        String num4="-23456789124355";

        BigNumber test1 = new BigNumber(num1);
        BigNumber test2 = new BigNumber(num2);
        BigNumber test3 = new BigNumber(num3);
        BigNumber test4 = new BigNumber(num4);

        BigInteger bigInteger1=new BigInteger(num1);
        BigInteger bigInteger2=new BigInteger(num2);
        BigInteger bigInteger3=new BigInteger(num3);
        BigInteger bigInteger4=new BigInteger(num4);

//        System.out.println(num1+" + "+num2);
//        System.out.println("BigNumber运算结果："+BigNumber.add(test1,test2).origin);
//        System.out.println("BigInteger运算结果："+bigInteger1.add(bigInteger2));
//        System.out.println(num3+" + "+num4);
//        System.out.println("BigNumber运算结果："+BigNumber.add(test3,test4).origin);
//        System.out.println("BigInteger运算结果："+bigInteger3.add(bigInteger4));
//        System.out.println(num2+" + "+num3);
//        System.out.println("BigNumber运算结果："+BigNumber.add(test2,test3).origin);
//        System.out.println("BigInteger运算结果："+bigInteger2.add(bigInteger3));

//        System.out.println(num1+" - "+num2);
//        System.out.println("BigNumber运算结果："+BigNumber.subtract(test1,test2).origin);
//        System.out.println("BigInteger运算结果："+bigInteger1.subtract(bigInteger2));
//        System.out.println(num3+" - "+num4);
//        System.out.println("BigNumber运算结果："+BigNumber.subtract(test3,test4).origin);
//        System.out.println("BigInteger运算结果："+bigInteger3.subtract(bigInteger4));
//        System.out.println(num2+" - "+num3);
//        System.out.println("BigNumber运算结果："+BigNumber.subtract(test2,test3).origin);
//        System.out.println("BigInteger运算结果："+bigInteger2.subtract(bigInteger3));

//        System.out.println(num1+" × "+num2);
//        System.out.println("BigNumber运算结果："+ test1.multiply(test2).origin);
//        System.out.println("BigInteger运算结果："+bigInteger1.multiply(bigInteger2));
//        System.out.println(num2+" x "+num3);
//        System.out.println("BigNumber运算结果："+test2.multiply(test3).origin);
//        System.out.println("BigInteger运算结果："+bigInteger2.multiply(bigInteger3));


        System.out.println(num1+" ÷ "+num3);
        System.out.println("BigNumber运算结果："+BigNumber.divide(test1,test3).origin);
        System.out.println("BigInteger运算结果："+bigInteger1.divide(bigInteger3));

    }

}
